package com.quectel.grid.controller.village;

import com.quectel.core.module.village.dto.VillageFloorDto;
import com.quectel.core.module.village.service.VillageFloorService;
import com.quectel.core.module.village.service.VillageRoomService;
import com.quectel.grid.controller.BaseController;
import com.quectel.util.common.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 在这里编写说明
 *
 * @author: bob
 * @email: bob.yu@quectel.com
 * @date: 2023-02-16 09:45:00
 */
@RestController
@RequestMapping("villageFloor")
@Tag(name = "VillageFloorController", description = "实有楼层相关api")
public class VillageFloorController extends BaseController {

    @DubboReference
    private VillageFloorService villageFloorService;
    @DubboReference
    private VillageRoomService villageRoomService;

    @GetMapping("queryByBuildingId")
    @Operation(summary = "楼栋筛选楼层")
    public Response<List<VillageFloorDto>> queryByBuildingId(
            @Parameter(description = "楼栋") @RequestParam Long buildingId
    ) {

        return Response.<List<VillageFloorDto>>ok().wrap(villageFloorService.selectByBuildingId(buildingId));
    }
}

